The present invention relates to texture processors for performing bilinear filtering used in the field of computer graphics and other fields.
In recent years, many game machines and car navigation systems use texture mapping with which patterns are mapped to objects so as to obtain realistic images. In the texture mapping, texture coordinates (U, V) corresponding to the (X, Y) coordinates of each pixel constituting an object are calculated so that texture data is taken out and rendered from a texture on a two-dimensional grid based on the texture coordinates (U, V).
The texture coordinates (U, V) have decimal fractions, and thus the coordinates do not always coincide with coordinates on the two-dimensional grid of the texture. Examples of methods for taking texture data include: point sampling in which the texture coordinates (U, V) are rounded to integers and texture data on a two-dimensional grid is taken out; and bilinear filtering in which the average of texture data at four neighboring points is calculated using decimal fractions of the texture coordinates (U, V). Bilinear filtering allows interpolation of texture data even if the texture coordinates (U, V) cannot be rounded to integers. Accordingly, even in the case of altering the shape of objects or rotating the objects, the bilinear filtering generally provides higher image quality than the point sampling.
FIG. 19 shows a concept of bilinear filtering. In FIG. 19, T is the position indicated by texture coordinates (U, V), p is the decimal fraction of U, q is the decimal fraction of V, 0≦p<1 and 0≦q<1. T0, T1, T2 and T3 are texture data at respective four closest points to T on a two-dimensional grid. Suppose the integer fractions of T are (u, v), the coordinates of T0 are (u, v), the coordinates of T1 are (u+1, v), the coordinates of T2 are (u, v+1) and the coordinates of T3 are (u+1, v+1).
Bilinear filtering uses the following equation:T=(1−p)×(1−q)×T0+p×(1−q)×T1+(1−p)×q×T2+p×q×T3The RGB values of T0, T1, T2 and T3 are calculated using this equation.
As described above, bilinear filtering requires texture data at four points in order to create one texture. To perform texture mapping with LSI, a texture is once stored in an internal memory and then is referred to. In the case of bilinear filtering, it is necessary to refer to the internal memory four times in order to create one texture. Therefore, processing speed is low.
To perform bilinear filtering at high speed, proposed is a technique in which a texture is divided into data sets having coordinates (2m, 2n), (2m+1, 2n), (2m, 2n+1) and (2m+1, 2n+1), respectively, (where m and n are integers) on a two-dimensional grid and the divided texture data sets are stored in respective four memories so that these texture data sets are read out from the four memories at the same time during bilinear filtering (e.g., Japanese Unexamined Patent Publication (Kokai) No. 11-154237.)